*********************************************************************
*** Political costs of trade war tariffs 
*** Edward D. Mansfield & Omer Solodoch 
*** Replication code for analysis of Google Trends and Lexis Nexis data  
*********************************************************************
*** Note: replicators must install the following packages from the SSC Archive:
*** ssc install scheme_rbn1mono
*********************************************************************
clear all
set mem 600m
set matsize 800	
version 17
set more off
set logtype text
set scheme s1mono
*** Set working directory
capture cd "XXXX"
*** Load dataset
use "MSJOP_Google.dta", clear

************************************************************
*** Figure A-1: panel (a) News Articles
************************************************************
set scheme rbn3mono
line articles day_id, xline(15, lp(dash) lc(maroon)) ///
xlabel(10(1)20, angle(horizontal) labsize(medium)) xscale(range(10 20)) xt("June 2018") ///
yt("Number of articles", size(medium)) yscale(range(0 400) titlegap(*0)) ylabel(0(50)400, labsize(medium)) title("") legend(off) ///
 || scatter articles day_id, msymbol(O)

************************************************************
*** Figure A-1: panel (b) Google Searches
************************************************************
line tradewar_google day_id, xline(15, lp(dash) lc(maroon)) ///
xlabel(10(1)20, angle(horizontal) labsize(medium)) xscale(range(10 20)) xt("June 2018") ///
yt("Intensity of Google searches: {it:Trade War}", size(medium)) yscale(range(0 100) titlegap(*0)) ylabel(0(20)100, labsize(medium)) title("") legend(off) ///
 || scatter tradewar_google day_id, msymbol(O)
